using System;
using System.Text;
namespace Game
{
public class RofLanguageRow : IRofBase
{
public int ID { get; private set; }
public string Key { get; private set; }
public string Desc { get; private set; }
public string ChineseSimplified { get; private set; }
public string ChineseTraditional { get; private set; }
public string English { get; private set; }
public int ReadBody(byte[] rData, int nOffset)
{
if (BitConverter.IsLittleEndian){Array.Reverse(rData, nOffset, 4);}
ID = (int)BitConverter.ToUInt32(rData, nOffset); nOffset += 4;
if (BitConverter.IsLittleEndian){Array.Reverse(rData, nOffset, 4);}
int nKeyLen = (int)BitConverter.ToUInt32(rData, nOffset); nOffset += 4;
Key = Encoding.UTF8.GetString(rData, nOffset, nKeyLen); nOffset += nKeyLen;
if (BitConverter.IsLittleEndian){Array.Reverse(rData, nOffset, 4);}
int nDescLen = (int)BitConverter.ToUInt32(rData, nOffset); nOffset += 4;
Desc = Encoding.UTF8.GetString(rData, nOffset, nDescLen); nOffset += nDescLen;
if (BitConverter.IsLittleEndian){Array.Reverse(rData, nOffset, 4);}
int nChineseSimplifiedLen = (int)BitConverter.ToUInt32(rData, nOffset); nOffset += 4;
ChineseSimplified = Encoding.UTF8.GetString(rData, nOffset, nChineseSimplifiedLen); nOffset += nChineseSimplifiedLen;
if (BitConverter.IsLittleEndian){Array.Reverse(rData, nOffset, 4);}
int nChineseTraditionalLen = (int)BitConverter.ToUInt32(rData, nOffset); nOffset += 4;
ChineseTraditional = Encoding.UTF8.GetString(rData, nOffset, nChineseTraditionalLen); nOffset += nChineseTraditionalLen;
if (BitConverter.IsLittleEndian){Array.Reverse(rData, nOffset, 4);}
int nEnglishLen = (int)BitConverter.ToUInt32(rData, nOffset); nOffset += 4;
English = Encoding.UTF8.GetString(rData, nOffset, nEnglishLen); nOffset += nEnglishLen;
return nOffset;
}
}
}
